package com.qingcheng.controller.order;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.pojo.order.CategoryReport;
import com.qingcheng.service.order.CategoryReportService;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * Welcome to the most Amazing IntelliJ IIIDEA.
 * Creat0r: ^_^ fffantianxing ^_^
 * Date: 2019-06-27
 * Time: 20:45
 */

@RestController
@RequestMapping("categoryReport")
public class CategoryReportController {

    @Reference
    private CategoryReportService categoryReportService;

    @RequestMapping("yesterday")
    public List<CategoryReport> yesterday() {
        LocalDate localDate = LocalDate.of(2019, 04, 15);
        System.out.println(111);
        return categoryReportService.categoryReport(localDate);
    }

    @GetMapping("category1")
    public List<Map> category(String date1, String date2) {
        return categoryReportService.category1(date1, date2);
    }
}
